<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        html,body{
            height: 100%;
            width: 100%;
            margin: 0px;
            padding: 0px;
        }
        .container{
            width: 1000px;
            background-color: red;
            /* 1. */
            margin-left:auto;
            margin-right: auto;
            /* 2. */
            /* margin: auto; */
            /* 3. */
            /* margin: 0 auto; */
            
        }
    </style>
</head>
<body>
    <div class="container">123
    </div>
</body>
</html>